package com.small.base.es;

import com.small.base.es.core.ElasticsearchService;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * ElasticsearchConfiguration
 *
 * @author miajio
 */
@Configuration
@EnableConfigurationProperties(ElasticsearchProperties.class)
public class ElasticsearchConfiguration {
    @Resource
    private ElasticsearchProperties elasticsearchProperties;

    @Bean
    public ElasticsearchService elasticsearchService() {
        return new ElasticsearchService(elasticsearchProperties);
    }

}
